# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Poly.V1.Model.Format do
  @moduledoc """
  The same asset can be represented in different formats, for example, a [WaveFront .obj](//en.wikipedia.org/wiki/Wavefront_.obj_file) file with its corresponding .mtl file or a [Khronos glTF](//www.khronos.org/gltf) file with its corresponding .glb binary data. A format refers to a specific representation of an asset and contains all information needed to retrieve and describe this representation.

  ## Attributes

  *   `formatComplexity` (*type:* `GoogleApi.Poly.V1.Model.FormatComplexity.t`, *default:* `nil`) - Complexity stats about this representation of the asset.
  *   `formatType` (*type:* `String.t`, *default:* `nil`) - A short string that identifies the format type of this representation. Possible values are: `FBX`, `GLTF`, `GLTF2`, `OBJ`, and `TILT`.
  *   `resources` (*type:* `list(GoogleApi.Poly.V1.Model.File.t)`, *default:* `nil`) - A list of dependencies of the root element. May include, but is not limited to, materials, textures, and shader programs.
  *   `root` (*type:* `GoogleApi.Poly.V1.Model.File.t`, *default:* `nil`) - The root of the file hierarchy. This will always be populated. For some format_types - such as `TILT`, which are self-contained - this is all of the data. Other types - such as `OBJ` - often reference other data elements. These are contained in the resources field.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :formatComplexity => GoogleApi.Poly.V1.Model.FormatComplexity.t() | nil,
          :formatType => String.t() | nil,
          :resources => list(GoogleApi.Poly.V1.Model.File.t()) | nil,
          :root => GoogleApi.Poly.V1.Model.File.t() | nil
        }

  field(:formatComplexity, as: GoogleApi.Poly.V1.Model.FormatComplexity)
  field(:formatType)
  field(:resources, as: GoogleApi.Poly.V1.Model.File, type: :list)
  field(:root, as: GoogleApi.Poly.V1.Model.File)
end

defimpl Poison.Decoder, for: GoogleApi.Poly.V1.Model.Format do
  def decode(value, options) do
    GoogleApi.Poly.V1.Model.Format.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Poly.V1.Model.Format do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
